package phan.connection;

import java.io.*;
import javax.jms.Session;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.fileupload.*;
import org.apache.tomcat.util.http.fileupload.FileUpload;
import org.apache.commons.fileupload.DiskFileUpload;
import java.util.List;
import org.apache.commons.fileupload.disk.*;
import org.apache.commons.fileupload.servlet.*;
import java.util.*;
import java.io.*;
import java.io.InputStream;

/**
 * Servlet implementation class for Servlet: LoginServlet
 *
 */
public class RegistrerObjet2 extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
    /* (non-Java-doc)
     * @see javax.servlet.http.HttpServlet#HttpServlet()
     */

    public RegistrerObjet2() {
        super();
    }

    /* (non-Java-doc)
     * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
    }

    /* (non-Java-doc)
     * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
     */
    int i;

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        try {
            HttpSession session = request.getSession(false);

            session.getAttribute("user");
            String username = session.getAttribute("user").toString();
            System.out.print("nguoi nay dang o trong phien lam vien  " + username);
            System.out.print("hello world oiiiiiiiiiiiii");
            ElementBean f = (ElementBean) request.getAttribute("formHandler");

        } catch (Exception e) {
            System.out.print(e.getMessage());
        }
    }
}